package com.itools.core.em;

import com.itools.core.utils.StringUtils;

/**
 * @project: itools-backend
 * @description:
 * @author: XUCHANG
 * @create: 2021-04-01 16:02
 */
public enum StrategyType {
    NIO("nio", "NIO","nioFileManagerServiceImpl"),
    MINIO("minio", "minio文件系统","minioFileManagerServiceImpl"),
    FASTDFS("fastdfs", "fastdfs文件系统","fastDfsFileManagerServiceImpl");
    private String type;
    private String desc;
    private String beanName;

    StrategyType(String type, String desc,String beanName) {
        this.type = type;
        this.desc = desc;
        this.beanName = beanName;
    }

    public String getType() {
        return type;
    }

    public static String getType(String beanName) {
        for (StrategyType strategyType : StrategyType.values()){
            if (StringUtils.equals(beanName,strategyType.beanName)){
                return strategyType.type;
            }
        }
        return null;
    }
}